{include file="common_top.html"}
	{include file="common_head.html"}
</head>
<body class="dictbody">
	<div class="datain">
		<form action="/index.php?a=dict&m=search&t=ajax" method="post">
			<textarea class="txt" rows="5" name="content"></textarea>
			<input type="submit" class="btn" value="搜索" />
		</form>
	</div>
	<ul class="dataout"></ul>
	<script type="text/javascript">
	{literal}
		var H_WindowResize = function(){
			var t_h = $(window).height();
			var s_h = $(".datain").innerHeight() + 20;
			if(t_h - s_h > 0){
				$(".dataout").css("height", (t_h - s_h) + "px");
			}
		};
		var H_Submit = function(){
			// Clear
			$(".dataout").html("");

			// Submit
			$.fn.dyAjaxForm($("form"), {dataType: "JSON", onEvent: {success: function(result){
				if(result.state){
					var html = "";
					for(var i = 0; i < result.data.length; i++){
						html += "<li>" + result.data[i].en + "<br />" + result.data[i].cn + "</li>";
					}
					$(".dataout").html(html);
				}else{
					$(".dataout").html("<li>" + result.message + "</li>");
				}
			}, error: function(jqXHR, textStatus, errorThrown){
				$(".dataout").html("<li>AJAX请求出错[ " + errorThrown + " ]</li>");
			}}});
			return false;
		};
		$(function(){
			$(window).bind("resize", H_WindowResize);
		});
		$("form").submit(H_Submit);
	{/literal}
	</script>
{include file="common_bottom.html"}
